SPB Git

Repository Public

route.ts 707 B 13 lines typescript

1import { approve, OpError } from "@/lib/studio-ops";2import { isUuid, out, studio } from "@/lib/studio-api";34/** POST /api/studio/films/:id/approve — :id is the project id. { override?: boolean, note?: string }; overriding a failed QA is owner-only and needs a reason. */5export async function POST(req: Request, ctx: { params: Promise<{ id: string }> }) {6  const { id } = await ctx.params;7  return studio(req, "editor", async (user, body) => {8    if (!isUuid(id)) throw new OpError("Project not found", 404);9    await approve(user, id, { override: body.override === true, note: typeof body.note === "string" ? body.note : undefined });10    return out({ projectId: id, status: "approved" });11  });12}13
Files main
Menu

Theme